package org.example.ssmioc1.bean;

import lombok.Data;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@ToString
@Data
@Component
@PropertySource("classpath:dog.properties")//导入配置文件来使用
public class dog {

@Value("${dog.name:'旺财'}")//:后面可以设置默认值
private String name;
}
